package com.megan.design.pattern.builder.v2;

import lombok.ToString;

/**
 * @author: megan
 * @eMail: meganmail@vip.qq.com
 * @date: 2019/1/10 16:25
 * @version: v1.0
 * @description: 课程
 */
@ToString
public class Course {

    private String courseName;

    private String coursePPT;

    private String courseVideo;

    private String courseArticle;

    // question & answer
    private String courseQa;

    public Course(CourseBuilder courseBuilder) {
        this.courseName = courseBuilder.courseName;
        this.coursePPT = courseBuilder.coursePPT;
        this.courseVideo = courseBuilder.courseVideo;
        this.courseArticle = courseBuilder.courseArticle;
        this.courseQa = courseBuilder.courseQa;
    }

    public static class CourseBuilder {

        private String courseName;

        private String coursePPT;

        private String courseVideo;

        private String courseArticle;

        private String courseQa;

        public CourseBuilder builderCourseName(String courseName) {
            this.courseName = courseName;
            return this;
        }

        public CourseBuilder builderCoursePPT(String coursePPT) {
            this.coursePPT = coursePPT;
            return this;
        }

        public CourseBuilder builderCourseVideo(String courseVideo) {
            this.courseVideo = courseVideo;
            return this;
        }

        public CourseBuilder builderCourseArticle(String courseArticle) {
            this.courseArticle = courseArticle;
            return this;
        }

        public CourseBuilder builderCourseQa(String courseQa) {
            this.courseQa = courseQa;
            return this;
        }

        public Course builder() {
            return new Course(this);
        }

    }
}
